import { ItemData } from "../../resource/info/ItemData";
import { TItemWeapon } from "../../../../Message/Db/Tables/TItemWeapon";
import { ECategory } from "../../../../Message/Public/ECategory";
import { PetEquipForgeConfig } from "../../resource/PetEquipForgeConfig";
import { Cache } from "../../cache/Cache";
import { ItemsUtil } from "../shortcuts/item/ItemsUtil";
import { CareerUtil } from "./util/CareerUtil";
import { Language } from "../../../../extend/language/Language";
import { EJewel } from "../../../../Message/Public/EJewel";
import { SpiritEquipStrengthenConfig } from "../../resource/SpiritEquipStrengthenConfig";
import { GameDefConfig } from "../../resource/GameDefConfig";
import { EPrefix } from "../../../../Message/Public/EPrefix";
import { EquipAdvanceConfig } from "../../resource/EquipAdvanceConfig";
import { EItemUpdateOper } from "../../../../Message/Game/EItemUpdateOper";
import { EquipmentToolTipData } from "../../resource/info/EquipmentToolTipData";
import { PetEquipTooltipInfo } from "../../resource/info/PetEquipTooltipInfo";
import { EEquip } from "../../../../Message/Public/EEquip";
import { EquipmentUtil } from "./util/EquipmentUtil";
import { EColor } from "../../../../Message/Public/EColor";
import { ArrayUtil } from "../../../../com/gengine/utils/ArrayUtil";
import { TItem } from "../../../../Message/Db/Tables/TItem";
import { ItemExInfo } from "../../resource/info/ItemExInfo";
type int = number;
//class EquipmentItemDataUtil
    
    export  class EquipmentItemDataUtil
    {
        constructor(arg1: ItemData)
        {
            
            this._eqItems = [];
            this._itemData = arg1;
            this.init();
            return;
        }

        /* internal  */init(): void
        {
            var loc1=null;
            if (this._itemData) 
            {
                loc1 = this._itemData.itemInfo;
                this._itemExInfo = this._itemData.itemExInfo;
                if (this._itemExInfo) 
                {
                    this._prefix = this._itemExInfo.prefix;
                }
                if (loc1) 
                {
                    this._tItem = loc1.item;
                    if (loc1.extend && loc1.extend is TItemWeapon) 
                    {
                        this._tItemWeap = loc1.extend as TItemWeapon;
                    }
                }
            }
            return;
        }

        public set itemData(arg1: ItemData)
        {
            this._itemData = arg1;
            this.init();
            return;
        }

        public get itemData(): ItemData
        {
            return this._itemData;
        }

        public getBasePropArray(arg1: Boolean=false, arg2: int=-1): Array<any>
        {
            var loc3=0;
            var loc4=false;
            var loc5=false;
            var loc6=null;
            var loc7=null;
            var loc8=null;
            var loc9=null;
            var loc10=null;
            var loc11=null;
            var loc12=null;
            var loc13=null;
            var loc14=null;
            var loc15=null;
            var loc16=null;
            var loc17=null;
            var loc18=null;
            var loc19=null;
            var loc20=null;
            var loc21=null;
            var loc22=null;
            var loc23=null;
            var loc24=null;
            var loc1=[];
            var loc2=1;
            if (this._itemData && this._itemData.category == ECategory._ECategoryPetEquip) 
            {
                loc2 = PetEquipForgeConfig.instance.getPrefixAddPercent(this._itemData.color, this._prefix);
            }
            else if (this._itemData) 
            {
                if (arg2 != -1) 
                {
                    loc2 = EquipmentItemDataUtil.getAddPercentage(arg2, this._itemData.type);
                }
                else 
                {
                    loc2 = EquipmentItemDataUtil.getAddPercentage(this._prefix, this._itemData.type);
                }
            }
            if (this._tItemWeap) 
            {
                loc3 = Cache.instance.role.careerBasic;
                loc4 = (ItemsUtil.isSpiritEquip(this._itemData) || ItemsUtil.isMountEquipt(this._itemData) || ItemsUtil.isEquipFashion(this._itemData)) && CareerUtil.isPhysicalCareer(loc3);
                if (!(loc5 = (ItemsUtil.isSpiritEquip(this._itemData) || ItemsUtil.isMountEquipt(this._itemData) || ItemsUtil.isEquipFashion(this._itemData)) && CareerUtil.isMagicCareer(loc3))) 
                {
                    if (this._tItemWeap.basePhysicalCrit != 0) 
                    {
                        (loc6 = new Map<any, any> /* flash.utils.Dictionary */())["name"] = Language.getString(11104);
                        loc6["type"] = EJewel._EJewelPhysicalCrit;
                        loc6["baseValue"] = this._tItemWeap.basePhysicalCrit;
                        loc6["value"] = int(loc2 * this._tItemWeap.basePhysicalCrit);
                        if (arg1) 
                        {
                            loc6["value"] = loc6["value"] + this.getBaseAdditive(loc6["value"]);
                        }
                        loc1.push(loc6);
                    }
                    if (this._tItemWeap.basePhysicalAttack != 0) 
                    {
                        (loc7 = new Map<any, any> /* flash.utils.Dictionary */())["name"] = Language.getString(90238);
                        loc7["type"] = EJewel._EJewelPhysicalAttack;
                        loc7["baseValue"] = this._tItemWeap.basePhysicalAttack;
                        loc7["value"] = int(loc2 * this._tItemWeap.basePhysicalAttack);
                        if (arg1) 
                        {
                            loc7["value"] = loc7["value"] + this.getBaseAdditive(loc7["value"]);
                        }
                        loc1.push(loc7);
                    }
                }
                if (!loc4) 
                {
                    if (this._tItemWeap.baseMagicCrit != 0) 
                    {
                        (loc8 = new Map<any, any> /* flash.utils.Dictionary */())["name"] = Language.getString(11105);
                        loc8["type"] = EJewel._EJewelMagicCrit;
                        loc8["baseValue"] = this._tItemWeap.baseMagicCrit;
                        loc8["value"] = int(loc2 * this._tItemWeap.baseMagicCrit);
                        if (arg1) 
                        {
                            loc8["value"] = loc8["value"] + this.getBaseAdditive(loc8["value"]);
                        }
                        loc1.push(loc8);
                    }
                    if (this._tItemWeap.baseMagicAttack != 0) 
                    {
                        (loc9 = new Map<any, any> /* flash.utils.Dictionary */())["name"] = Language.getString(90239);
                        loc9["type"] = EJewel._EJewelMagicAttack;
                        loc9["baseValue"] = this._tItemWeap.baseMagicAttack;
                        loc9["value"] = int(loc2 * this._tItemWeap.baseMagicAttack);
                        if (arg1) 
                        {
                            loc9["value"] = loc9["value"] + this.getBaseAdditive(loc9["value"]);
                        }
                        loc1.push(loc9);
                    }
                }
                if (this._tItemWeap.basePass != 0) 
                {
                    (loc10 = new Map<any, any> /* flash.utils.Dictionary */())["name"] = Language.getString(90321);
                    loc10["type"] = EJewel._EJewelPass;
                    loc10["baseValue"] = this._tItemWeap.basePass;
                    loc10["value"] = int(loc2 * this._tItemWeap.basePass);
                    if (arg1) 
                    {
                        loc10["value"] = loc10["value"] + this.getBaseAdditive(loc10["value"]);
                    }
                    loc1.push(loc10);
                }
                if (this._tItemWeap.basePhysicalDefense != 0) 
                {
                    (loc11 = new Map<any, any> /* flash.utils.Dictionary */())["name"] = Language.getString(90240);
                    loc11["type"] = EJewel._EJewelPhysicalDefense;
                    loc11["baseValue"] = this._tItemWeap.basePhysicalDefense;
                    loc11["value"] = int(loc2 * this._tItemWeap.basePhysicalDefense);
                    if (arg1) 
                    {
                        loc11["value"] = loc11["value"] + this.getBaseAdditive(loc11["value"]);
                    }
                    loc1.push(loc11);
                }
                if (this._tItemWeap.baseMagicDefense != 0) 
                {
                    (loc12 = new Map<any, any> /* flash.utils.Dictionary */())["name"] = Language.getString(90241);
                    loc12["type"] = EJewel._EJewelMagicDefense;
                    loc12["baseValue"] = this._tItemWeap.baseMagicDefense;
                    loc12["value"] = int(loc2 * this._tItemWeap.baseMagicDefense);
                    if (arg1) 
                    {
                        loc12["value"] = loc12["value"] + this.getBaseAdditive(loc12["value"]);
                    }
                    loc1.push(loc12);
                }
                if (this._tItemWeap.baseLife != 0) 
                {
                    (loc13 = new Map<any, any> /* flash.utils.Dictionary */())["name"] = Language.getString(90247);
                    loc13["type"] = EJewel._EJewelLife;
                    loc13["baseValue"] = this._tItemWeap.baseLife;
                    loc13["value"] = int(loc2 * this._tItemWeap.baseLife);
                    if (arg1) 
                    {
                        loc13["value"] = loc13["value"] + this.getBaseAdditive(loc13["value"]);
                    }
                    loc1.push(loc13);
                }
                if (this._tItemWeap.basePower != 0) 
                {
                    (loc14 = new Map<any, any> /* flash.utils.Dictionary */())["name"] = Language.getString(90242);
                    loc14["type"] = EJewel._EJewelPower;
                    loc14["baseValue"] = this._tItemWeap.basePower;
                    loc14["value"] = int(loc2 * this._tItemWeap.basePower);
                    if (arg1) 
                    {
                        loc14["value"] = loc14["value"] + this.getBaseAdditive(loc14["value"]);
                    }
                    loc1.push(loc14);
                }
                if (this._tItemWeap.baseAgile != 0) 
                {
                    (loc15 = new Map<any, any> /* flash.utils.Dictionary */())["name"] = Language.getString(90243);
                    loc15["type"] = EJewel._EJewelAgile;
                    loc15["baseValue"] = this._tItemWeap.baseAgile;
                    loc15["value"] = int(loc2 * this._tItemWeap.baseAgile);
                    if (arg1) 
                    {
                        loc15["value"] = loc15["value"] + this.getBaseAdditive(loc15["value"]);
                    }
                    loc1.push(loc15);
                }
                if (this._tItemWeap.baseHabitus != 0) 
                {
                    (loc16 = new Map<any, any> /* flash.utils.Dictionary */())["name"] = Language.getString(90244);
                    loc16["type"] = EJewel._EJewelHabitus;
                    loc16["baseValue"] = this._tItemWeap.baseHabitus;
                    loc16["value"] = int(loc2 * this._tItemWeap.baseHabitus);
                    if (arg1) 
                    {
                        loc16["value"] = loc16["value"] + this.getBaseAdditive(loc16["value"]);
                    }
                    loc1.push(loc16);
                }
                if (this._tItemWeap.baseBrains != 0) 
                {
                    (loc17 = new Map<any, any> /* flash.utils.Dictionary */())["name"] = Language.getString(90245);
                    loc17["type"] = EJewel._EJewelBrains;
                    loc17["baseValue"] = this._tItemWeap.baseBrains;
                    loc17["value"] = int(loc2 * this._tItemWeap.baseBrains);
                    if (arg1) 
                    {
                        loc17["value"] = loc17["value"] + this.getBaseAdditive(loc17["value"]);
                    }
                    loc1.push(loc17);
                }
                if (this._tItemWeap.baseSpiritual != 0) 
                {
                    (loc18 = new Map<any, any> /* flash.utils.Dictionary */())["name"] = Language.getString(90246);
                    loc18["type"] = EJewel._EJewelSpiritual;
                    loc18["baseValue"] = this._tItemWeap.baseSpiritual;
                    loc18["value"] = int(loc2 * this._tItemWeap.baseSpiritual);
                    if (arg1) 
                    {
                        loc18["value"] = loc18["value"] + this.getBaseAdditive(loc18["value"]);
                    }
                    loc1.push(loc18);
                }
                if (this._tItemWeap.harmDeeper != 0) 
                {
                    (loc19 = new Map<any, any> /* flash.utils.Dictionary */())["name"] = Language.getString(90310);
                    loc19["type"] = EJewel._EJewelHarmDeeper;
                    loc19["baseValue"] = this._tItemWeap.harmDeeper;
                    loc19["value"] = int(loc2 * this._tItemWeap.harmDeeper);
                    if (arg1) 
                    {
                        loc19["value"] = loc19["value"] + this.getBaseAdditive(loc19["value"]);
                    }
                    loc1.push(loc19);
                }
                if (this._tItemWeap.harmLower != 0) 
                {
                    (loc20 = new Map<any, any> /* flash.utils.Dictionary */())["name"] = Language.getString(90311);
                    loc20["type"] = EJewel._EJewelHarmLower;
                    loc20["baseValue"] = this._tItemWeap.harmLower;
                    loc20["value"] = int(loc2 * this._tItemWeap.harmLower);
                    if (arg1) 
                    {
                        loc20["value"] = loc20["value"] + this.getBaseAdditive(loc20["value"]);
                    }
                    loc1.push(loc20);
                }
                if (this._tItemWeap.baseHit != 0) 
                {
                    (loc21 = new Map<any, any> /* flash.utils.Dictionary */())["name"] = Language.getString(11111);
                    loc21["type"] = EJewel._EJewelHit;
                    loc21["baseValue"] = this._tItemWeap.baseHit;
                    loc21["value"] = int(loc2 * this._tItemWeap.baseHit);
                    if (arg1) 
                    {
                        loc21["value"] = loc21["value"] + this.getBaseAdditive(loc21["value"]);
                    }
                    loc1.push(loc21);
                }
                if (this._tItemWeap.baseJouk != 0) 
                {
                    (loc22 = new Map<any, any> /* flash.utils.Dictionary */())["name"] = Language.getString(11112);
                    loc22["type"] = EJewel._EJewelJouk;
                    loc22["baseValue"] = this._tItemWeap.baseJouk;
                    loc22["value"] = int(loc2 * this._tItemWeap.baseJouk);
                    if (arg1) 
                    {
                        loc22["value"] = loc22["value"] + this.getBaseAdditive(loc22["value"]);
                    }
                    loc1.push(loc22);
                }
                if (this._tItemWeap.baseToughness != 0) 
                {
                    (loc23 = new Map<any, any> /* flash.utils.Dictionary */())["name"] = Language.getString(11116);
                    loc23["type"] = EJewel._EJewelToughness;
                    loc23["baseValue"] = this._tItemWeap.baseToughness;
                    loc23["value"] = int(loc2 * this._tItemWeap.baseToughness);
                    if (arg1) 
                    {
                        loc23["value"] = loc23["value"] + this.getBaseAdditive(loc23["value"]);
                    }
                    loc1.push(loc23);
                }
                if (this._tItemWeap.baseRelief != 0) 
                {
                    (loc24 = new Map<any, any> /* flash.utils.Dictionary */())["name"] = Language.getString(90318);
                    loc24["type"] = EJewel._EJewelRelief;
                    loc24["baseValue"] = this._tItemWeap.baseToughness;
                    loc24["value"] = int(loc2 * this._tItemWeap.baseToughness);
                    if (arg1) 
                    {
                        loc24["value"] = loc24["value"] + this.getBaseAdditive(loc24["value"]);
                    }
                    loc1.push(loc24);
                }
            }
            return loc1;
        }

        public getBaseAdditive(arg1: int): int
        {
            var loc5=null;
            var loc6=NaN;
            var loc1=0;
            var loc2=0;
            var loc3=0;
            var loc4=0;
            if (this.itemData.category == ECategory._ECategorySpiritEquip) 
            {
                if (this._itemExInfo) 
                {
                    loc3 = this._itemExInfo.sp_eq_str;
                }
                if (loc5 = SpiritEquipStrengthenConfig.instance.getSpiritEquipStrengthenInfo(this.itemData.color, loc3)) 
                {
                    loc6 = loc5.percentAdd / 100;
                    loc1 = Math.ceil(arg1 * loc6 / 100);
                }
            }
            else 
            {
                if (this._itemExInfo) 
                {
                    loc3 = this._itemExInfo.strengthen;
                    loc4 = this._itemExInfo.totalStrengthen ? this._itemExInfo.totalStrengthen : 0;
                    loc2 = this._prefix;
                }
                if (loc3 > 0 || loc2 > 0) 
                {
                    loc1 = Math.ceil(arg1 * (1 + 0.01 * loc4) - arg1);
                }
            }
            return loc1;
        }

        public getPetEquipStarAddValue(arg1: int): int
        {
            var loc1=0;
            var loc2=NaN;
            if (this._itemData.category == ECategory._ECategoryPetEquip) 
            {
                loc1 = this._itemExInfo.p_equip_star;
                loc2 = PetEquipForgeConfig.instance.getEquipBaseStarValue(this._itemData.type, this._itemData.color, this._itemData.itemInfo.item.level, arg1);
                return Math.ceil(loc1 * loc2);
            }
            return 0;
        }

        public getAddtionalArray(arg1: Boolean=false, arg2: Boolean=false): Array<any>
        {
            var loc5=null;
            var loc6=0;
            var loc7=0;
            var loc8=null;
            var loc9=null;
            var loc1=[];
            var loc2=[];
            var loc3=this._itemData.refLockDic;
            if (this._itemExInfo) 
            {
                loc2.push(this._itemExInfo.addition1);
                loc2.push(this._itemExInfo.addition2);
                loc2.push(this._itemExInfo.addition3);
                loc2.push(this._itemExInfo.addition4);
                loc2.push(this._itemExInfo.addition5);
                loc2.push(this._itemExInfo.addition6);
            }
            else if (ItemsUtil.isIllustrate(this._itemData)) 
            {
                loc5 = GameDefConfig.instance.getEJewelArray();
                loc6 = 0;
                while (loc6 < loc5.length) 
                {
                    loc2.push(loc5[loc6].id);
                    ++loc6;
                }
            }
            var loc4=0;
            while (loc4 < loc2.length) 
            {
                if ((loc7 = loc2[loc4]) > 0) 
                {
                    loc8 = new Map<any, any> /* flash.utils.Dictionary */();
                    if (loc9 = GameDefConfig.instance.getEJewel(loc7)) 
                    {
                        if (arg2) 
                        {
                            loc8["name"] = loc9.text1;
                        }
                        else 
                        {
                            loc8["name"] = loc9.name;
                        }
                    }
                    else 
                    {
                        loc8["name"] = "";
                    }
                    if (ItemsUtil.isIllustrate(this._itemData)) 
                    {
                        loc8["value"] = this.getBaseValueByAddition(loc7);
                    }
                    else 
                    {
                        loc8["value"] = this._itemExInfo["ref_val" + (loc4 + 1)];
                        loc8["star"] = this._itemExInfo["addStar" + (loc4 + 1)];
                    }
                    if (loc3[loc4 + 1] == null) 
                    {
                        loc8["lock"] = false;
                    }
                    else 
                    {
                        loc8["lock"] = true;
                    }
                    loc8["type"] = loc7;
                    loc8["position"] = loc4 + 1;
                    loc8["addition"] = loc7;
                    if (ItemsUtil.isIllustrate(this._itemData) && !(this.getBaseValueByAddition(loc7) == 0)) 
                    {
                        loc1.push(loc8);
                    }
                    else if (!ItemsUtil.isIllustrate(this._itemData)) 
                    {
                        loc1.push(loc8);
                    }
                }
                ++loc4;
            }
            return loc1;
        }

        public getNewAddtionalArray(arg1: Boolean=false, arg2: Boolean=false, arg3: int=0): Array<any>
        {
            var loc3=null;
            var loc4=null;
            var loc5=0;
            var loc6=0;
            var loc7=0;
            var loc8=0;
            var loc9=null;
            var loc10=null;
            var loc1=[];
            var loc2=this._itemExInfo ? this._itemExInfo.ref_lock.split(",") : [];
            if (this._itemExInfo && this._itemExInfo.refDict && this._itemExInfo.refDict.length > 0) 
            {
                loc3 = this._itemExInfo.refDict[0];
                loc8 = 0;
                while (loc8 < loc3.length) 
                {
                    if ((loc4 = loc3[loc8]) && loc4[0] > 0) 
                    {
                        loc5 = loc4[0];
                        loc6 = loc4[1];
                        loc7 = loc4[2];
                        loc9 = new Map<any, any> /* flash.utils.Dictionary */();
                        if (loc10 = GameDefConfig.instance.getEJewel(loc5)) 
                        {
                            if (arg2) 
                            {
                                loc9["name"] = loc10.text1;
                            }
                            else 
                            {
                                loc9["name"] = loc10.name;
                            }
                        }
                        else 
                        {
                            loc9["name"] = "";
                        }
                        loc9["value"] = loc7;
                        loc9["star"] = loc6;
                        if (loc8 < (loc2.length - 1)) 
                        {
                            loc9["lock"] = true;
                        }
                        else 
                        {
                            loc9["lock"] = false;
                        }
                        loc9["position"] = loc8 + 1;
                        loc1.push(loc9);
                    }
                    ++loc8;
                }
            }
            return loc1;
        }

        public getBaseValueByAddition(arg1: int): int
        {
            var loc1=0;
            if (this._tItemWeap) 
            {
                var loc2=arg1;
                switch (loc2) 
                {
                    case EJewel._EJewelAgile:
                    {
                        loc1 = this._tItemWeap.agile;
                        break;
                    }
                    case EJewel._EJewelBlock:
                    {
                        loc1 = this._tItemWeap.block;
                        break;
                    }
                    case EJewel._EJewelBrains:
                    {
                        loc1 = this._tItemWeap.brains;
                        break;
                    }
                    case EJewel._EJewelHabitus:
                    {
                        loc1 = this._tItemWeap.habitus;
                        break;
                    }
                    case EJewel._EJewelHit:
                    {
                        loc1 = this._tItemWeap.hit;
                        break;
                    }
                    case EJewel._EJewelJouk:
                    {
                        loc1 = this._tItemWeap.jouk;
                        break;
                    }
                    case EJewel._EJewelLife:
                    {
                        loc1 = this._tItemWeap.life;
                        break;
                    }
                    case EJewel._EJewelMagicAttack:
                    {
                        loc1 = this._tItemWeap.magicAttack;
                        break;
                    }
                    case EJewel._EJewelMagicCrit:
                    {
                        loc1 = this._tItemWeap.magicCrit;
                        break;
                    }
                    case EJewel._EJewelMagicDefense:
                    {
                        loc1 = this._tItemWeap.magicDefense;
                        break;
                    }
                    case EJewel._EJewelMana:
                    {
                        loc1 = this._tItemWeap.mana;
                        break;
                    }
                    case EJewel._EJewelPass:
                    {
                        loc1 = this._tItemWeap.pass;
                        break;
                    }
                    case EJewel._EJewelPhysicalAttack:
                    {
                        loc1 = this._tItemWeap.physicalAttack;
                        break;
                    }
                    case EJewel._EJewelPhysicalCrit:
                    {
                        loc1 = this._tItemWeap.physicalCrit;
                        break;
                    }
                    case EJewel._EJewelPhysicalDefense:
                    {
                        loc1 = this._tItemWeap.physicalDefense;
                        break;
                    }
                    case EJewel._EJewelPower:
                    {
                        loc1 = this._tItemWeap.power;
                        break;
                    }
                    case EJewel._EJewelRelief:
                    {
                        loc1 = this._tItemWeap.relief;
                        break;
                    }
                    case EJewel._EJewelSpeededUp:
                    {
                        loc1 = this._tItemWeap.speededUp;
                        break;
                    }
                    case EJewel._EJewelSpiritual:
                    {
                        loc1 = this._tItemWeap.spiritual;
                        break;
                    }
                    case EJewel._EJewelToughness:
                    {
                        loc1 = this._tItemWeap.toughness;
                        break;
                    }
                }
            }
            return loc1;
        }

        public getAddtionalReal(arg1: int, arg2: int): int
        {
            var loc1=0;
            var loc4;
            var loc2=loc4 = EPrefix._EPrefixPerfect;
            loc2 = loc4;
            var loc3=0;
            if (this._itemData && this._itemExInfo) 
            {
                loc3 = EquipAdvanceConfig.instance.getTimesByStar(arg2);
            }
            loc1 = Math.floor(loc3 * Math.floor(arg1 * EquipmentItemDataUtil.getAddPercentage(loc2, this._itemData.type)) / 100);
            return loc1 < 1 ? 1 : loc1;
        }

        public getHighestEquip(arg1: int): ItemData
        {
            var loc5=null;
            var loc6=null;
            if (!this._itemData) 
            {
                return null;
            }
            var loc1=new ItemData(this._itemData.itemCode);
            var loc2=this._itemData.itemExInfo.duplicate();
            loc2.durable = (this._itemData.itemInfo.extend as TItemWeapon).durableUpper;
            loc2.score = -1;
            loc2.perfectStrengthen = 100;
            loc2.strengthen = 11;
            if (arg1 != EItemUpdateOper._EItemUpdateOperPetEquipStrengthen) 
            {
                loc2.totalStrengthen = this.getTotalStrengthen();
            }
            else 
            {
                loc2.totalStrengthen = this.getTotalPetStrengthen();
            }
            var loc3=this.getTopAdditions(this._itemData.itemInfo.extend["career"], this._itemData.type, this._itemData.color);
            var loc4=1;
            while (loc4 <= 6) 
            {
                loc2["addition" + loc4] = loc3[(loc4 - 1)];
                loc2["addStar" + loc4] = loc3[(loc4 - 1)] != 0 ? 10 : 0;
                loc2["ref_val" + loc4] = this.getAddtionalReal(this.getBaseValueByAddition(loc2["addition" + loc4]), loc2["addStar" + loc4]);
                ++loc4;
            }
            loc1.modelId = this._itemData.modelId;
            loc1.name = this._itemData.name;
            loc1.url = this._itemData.url;
            loc1.itemExInfo = loc2;
            if (arg1 != EItemUpdateOper._EItemUpdateOperPetEquipStrengthen) 
            {
                loc6 = new EquipmentToolTipData(loc1, Cache.instance.pack.rolePackCache.getAllItemsEnabledCareer(), false, false, false, false, false, false, false);
                if (arg1 != EItemUpdateOper._EItemUpdateOperStrengthen) 
                {
                    if (arg1 == EItemUpdateOper._EItemUpdateOperRecast) 
                    {
                        loc6.isShowAddAttr = true;
                    }
                }
                else 
                {
                    loc6.isShowBaseAttr = true;
                }
                loc1.equipmentToolTipData = loc6;
            }
            else 
            {
                (loc5 = new PetEquipTooltipInfo(loc1)).isShowAddAttr = false;
                loc5.isShowInlayAttr = false;
                loc1.petEquipmentToolTipData = loc5;
            }
            return loc1;
        }

        /* internal  */getTopAdditions(arg1: int, arg2: int, arg3: int): Array<any>
        {
            var loc1=arg2;
            switch (loc1) 
            {
                case EEquip._EEquipWeapon: case EEquip._EEquipRing: case EEquip._EEquipJewelry:
                {
                    if (EquipmentUtil.isPhysicalEquip(arg1)) 
                    {
                        if (arg3 == EColor._EColorGreen) 
                        {
                            return [EJewel._EJewelPhysicalAttack, EJewel._EJewelPhysicalAttack, EJewel._EJewelPhysicalAttack, EJewel._EJewelPhysicalAttack, EJewel._EJewelPhysicalAttack, 0];
                        }
                        if (arg3 >= EColor._EColorBlue) 
                        {
                            return [EJewel._EJewelPhysicalAttack, EJewel._EJewelPhysicalAttack, EJewel._EJewelPhysicalAttack, EJewel._EJewelPhysicalAttack, EJewel._EJewelPhysicalAttack, EJewel._EJewelPhysicalAttack];
                        }
                    }
                    else if (EquipmentUtil.isMagicEquip(arg1)) 
                    {
                        if (arg3 == EColor._EColorGreen) 
                        {
                            return [EJewel._EJewelMagicAttack, EJewel._EJewelMagicAttack, EJewel._EJewelMagicAttack, EJewel._EJewelMagicAttack, EJewel._EJewelMagicAttack, 0];
                        }
                        if (arg3 >= EColor._EColorBlue) 
                        {
                            return [EJewel._EJewelMagicAttack, EJewel._EJewelMagicAttack, EJewel._EJewelMagicAttack, EJewel._EJewelMagicAttack, EJewel._EJewelMagicAttack, EJewel._EJewelMagicAttack];
                        }
                    }
                    break;
                }
                case EEquip._EEquipHelmet: case EEquip._EEquipShoulder: case EEquip._EEquipClothes: case EEquip._EEquipWristlet: case EEquip._EEquipGloves: case EEquip._EEquipBelt: case EEquip._EEquipPants: case EEquip._EEquipShoes: case EEquip._EEquipFashion: case EEquip._EEquipWing: case EEquip._EEquipFashionWeapon: case EEquip._EEquipFootPrint: case EEquip._EEquipBubble: case EEquip._EEquipSurround: case EEquip._EEquipWaistBelt: case EEquip._EEquipElf:
                {
                    if (arg3 == EColor._EColorGreen) 
                    {
                        return [EJewel._EJewelLife, EJewel._EJewelLife, EJewel._EJewelLife, EJewel._EJewelLife, EJewel._EJewelLife, 0];
                    }
                    if (arg3 >= EColor._EColorBlue) 
                    {
                        return [EJewel._EJewelLife, EJewel._EJewelLife, EJewel._EJewelLife, EJewel._EJewelLife, EJewel._EJewelLife, EJewel._EJewelLife];
                    }
                    break;
                }
            }
            return [0, 0, 0, 0, 0, 0];
        }

        /* internal  */getTotalStrengthen(): int
        {
            return EquipAdvanceConfig.instance.getTotalStrengthen();
        }

        /* internal  */getTotalPetStrengthen(): int
        {
            return EquipAdvanceConfig.instance.getTotalPetStrengthen();
        }

        public getAllPropArray(arg1: Boolean=false, arg2: Boolean=false): Array<any>
        {
            var loc1=this.getBasePropArray(arg1);
            var loc2=this.getAddtionalArray(arg2);
            var loc3;
            return loc3 = ArrayUtil.merge(loc1, loc2, "type", "value", ArrayUtil.MergeType_Plus);
        }

        public static getAddPercentage(arg1: int, arg2: int): number
        {
            if (arg2 == EEquip._EEquipFashion) 
            {
                return 1 + arg1 * 0.1;
            }
            if (arg2 == EEquip._EEquipHeartLock) 
            {
                return 1 + arg1 * 0.01;
            }
            return 1 + arg1 * 0.05;
        }

        public static checkIsBodyPartEquip(arg1: ItemData): Boolean
        {
            if (arg1.itemInfo.item.category == ECategory._ECategoryEquip) 
            {
                var loc1=arg1.itemInfo.item.type;
                switch (loc1) 
                {
                    case EEquip._EEquipHelmet: case EEquip._EEquipShoulder: case EEquip._EEquipClothes: case EEquip._EEquipWristlet: case EEquip._EEquipGloves: case EEquip._EEquipBelt: case EEquip._EEquipPants: case EEquip._EEquipShoes:
                    {
                        return true;
                    }
                }
            }
            return false;
        }

        /* internal */ /* var */_itemData: ItemData;

        /* internal */ /* var */_tItem: TItem;

        /* internal */ /* var */_tItemWeap: TItemWeapon;

        /* internal */ /* var */_itemExInfo: ItemExInfo;

        /* internal */ /* var */_hasGem: Boolean=false;

        /* internal */ /* var */_eqItems: Array<any>;

        /* internal */ /* var */_prefix: int=0;
    }
